//
//  HPButtonCustomer.m
//  HPZZTong
//
//  Created by panbin on 13-11-26.
//  Copyright (c) 2013年 Handpay. All rights reserved.
//

#import "HPButtonCustomer.h"
#import "DefineUtil.h"
#import "ZZTongDefine.h"

#define BUTTON_ICON_IMAGE_HW 25

@interface HPButtonCustomer()

@property (nonatomic, retain) UIImageView *imageArrow;

@end

@implementation HPButtonCustomer

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        _iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, (self.bounds.size.height - BUTTON_ICON_IMAGE_HW)/2, BUTTON_ICON_IMAGE_HW, BUTTON_ICON_IMAGE_HW)];
        [self addSubview:_iconImageView];
        
        _iconTitle = [[UILabel alloc] initWithFrame:CGRectMake(_iconImageView.frame.origin.x + _iconImageView.frame.size.width + 5, _iconImageView.frame.origin.y, (self.bounds.size.width - 3*BUTTON_ICON_IMAGE_HW), _iconImageView.frame.size.height)];
        _iconTitle.textColor = [UIColor grayColor];
//        [_iconTitle setFont:[UIFont systemFontOfSize:15.0f]];
        [self addSubview:_iconTitle];
        
        UIView* lineView = [[UIView alloc]initWithFrame:CGRectMake(self.bounds.size.width - BUTTON_ICON_IMAGE_HW - 20, 0, 1, self.bounds.size.height)];
        lineView.backgroundColor = UIColorFromRGB(0x8db6d2);
        [self addSubview:lineView];
        [lineView release];
        
        
        _imageArrow = [[UIImageView alloc] initWithFrame:CGRectMake((self.bounds.size.width - BUTTON_ICON_IMAGE_HW - 10), (self.bounds.size.height - 23)/2 + 4, 23, 14)];
        [_imageArrow setImage:[UIImage imageNamed:@"pull_down"]];
        [self addSubview:_imageArrow];
        
        _textFiled = [[UITextField alloc] initWithFrame:CGRectMake(8, 0, self.bounds.size.width - 30, self.bounds.size.height)];
        _textFiled.enabled = NO;
//        _textFiled.font = [UIFont systemFontOfSize:15.0f];
        _textFiled.placeholder = @"请选择银行卡";
        [self addSubview:_textFiled];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
}

- (void)dealloc {
    HP_RELEASE(_iconImageView);
    HP_RELEASE(_iconTitle);
    HP_RELEASE(_imageArrow);
    HP_RELEASE(_textFiled);
    [super dealloc];
}

@end
